function checkValidKey()
{
    if (document.getElementById("regname").value.length == 0) {
        alert("请输入会员名！");
        document.getElementById("regname").focus();
        return false;
    }
    
    return true;
}



function toggleCheckboxes(form)
{
    for (var i=0;i<form.elements.length;i++) {
        var e = form.elements[i];
        if (e.name != "chkall" && e.type == "checkbox")
            e.checked = form.chkall.checked;
    }
}



function confirmAction(action, form)
{
    action = action || "删除";
    form = form ? ("#"+form+" ") : "";
	if (jQuery(form + "input[@name='id[]'][@checked]").length == 0) {
	    alert("请选中要" + action + "的！");
	    return false;
	}
	
	return confirm("确定" + action + "？");
}
